var $innerList = $('#J_navMenu .innerList');
var $J_navMenu = $('#J_navMenu');
var setTimeoutAuto;
$('.menu ul li').each(function () {
    var $this = $(this);
    var index = $this.index();
    var $type = $(this).data("type");
    $this.on({
        'mouseenter': function () {
            clearTimeout(setTimeoutAuto);
            if ($type == 1) {
                $innerList.empty();
                var html = $this.find(".x_content").html();
                
                $innerList.append(html);
                $J_navMenu.stop(true).animate({ 'top': '198px' }, { queue: false, duration: 300 });
            }
            else {
                setTimeoutAuto = setTimeout(function () {
                    $J_navMenu.stop(true).animate({ 'top': '0' }, {
                        queue: false, duration: 300, complete: function () {
                            $innerList.empty();
                        }
                    });
                }, 100);
            }
        },
        'mouseleave': function () {
            setTimeoutAuto = setTimeout(function () {
                $J_navMenu.stop(true).animate({ 'top': '0' }, {
                    queue: false, duration: 300, complete: function () {
                        $innerList.empty();
                    }
                });
            }, 100);
        },
    })
});
$J_navMenu.on({
    'mouseenter': function () {
        clearTimeout(setTimeoutAuto);
    },
    'mouseleave': function () {
        $J_navMenu.stop(true).animate({ 'top': '0' }, {
            queue: false, duration: 300, complete: function () {
                $innerList.empty();
            }
        });
    }
});
function installLi(index) {
    console.log(index);
    console.log($(".menu ul li.menu_li").eq(index).html());
}